From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0002.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0003.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0004.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0001.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0005.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0002.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0001.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0006.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0003.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0002.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0007.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0004.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0003.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0008.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0005.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0004.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0009.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0006.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0005.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0010.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0008.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0007.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0011.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0009.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0008.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0012.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0010.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0009.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0013.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0011.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0010.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0014.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0012.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0011.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0015.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0013.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0012.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment.html From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0016.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0014.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0013.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0001.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0001.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0001.html From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0017.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0015.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0014.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0003.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0003.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0002.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0002.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0018.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0016.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0015.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0004.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0004.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0003.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0003.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0019.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0017.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0016.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0005.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0005.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0004.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0004.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment.html From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0020.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0018.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0017.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0006.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0006.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0005.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0005.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0001.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0021.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0019.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0018.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0007.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0007.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0006.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0006.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0002.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0022.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0020.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0019.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0008.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0008.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0007.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0007.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0004.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0023.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0021.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0020.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0009.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0009.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0008.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0008.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0005.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0024.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0022.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0021.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0010.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0010.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0009.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0009.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0006.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0025.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0023.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0022.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0011.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0011.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0010.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0010.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0007.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0026.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0024.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0023.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0012.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0012.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0011.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0011.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0008.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0027.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0025.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0024.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0013.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0013.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0012.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0012.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0009.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0001.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0028.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0026.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0025.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0014.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0014.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0013.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0013.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0010.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0002.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0029.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0027.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0026.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0015.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0015.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0014.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0014.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0011.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0004.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0030.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0028.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0027.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0016.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0016.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0015.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0015.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0012.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0005.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0031.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0029.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0028.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0017.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0017.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0016.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0016.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0013.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0006.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0032.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0030.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0029.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0018.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0018.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0017.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0017.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0014.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0007.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0033.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0031.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0030.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0019.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0019.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0018.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0018.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0015.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0008.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0034.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0032.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0031.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0020.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0020.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0019.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0019.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0016.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0009.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0035.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0033.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0032.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0021.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0021.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0020.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0020.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0017.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0010.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0036.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0034.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0033.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0022.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0022.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0021.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0021.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0018.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0011.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0037.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0035.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0034.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0023.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0023.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0022.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0022.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0019.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0012.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0038.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0036.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0035.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0024.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0024.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0023.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0023.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0020.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0013.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0039.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0037.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0036.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0025.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0025.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0024.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0024.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0021.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0014.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0040.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0038.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0037.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0026.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0026.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0025.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0025.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0022.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0015.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0041.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0039.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0038.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0027.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0027.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0026.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0026.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0023.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0016.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0042.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0040.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0039.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0028.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0028.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0027.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0027.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0024.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0017.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0043.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0041.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0040.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0029.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0029.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0028.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0028.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0025.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0018.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0044.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0042.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0041.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0030.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0030.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0029.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0029.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0026.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0019.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0045.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0043.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0042.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0031.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0031.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0030.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0030.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0027.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0020.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0046.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0044.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0043.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0032.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0032.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0031.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0031.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0028.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0021.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0047.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0045.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0044.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0033.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0033.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0032.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0032.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0029.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0022.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0048.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0046.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0045.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0034.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0034.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0033.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0033.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0030.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0023.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0049.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0047.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0046.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0035.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0035.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0034.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0034.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0031.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0024.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0050.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0048.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0047.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0036.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0036.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0035.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0035.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0032.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0025.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0051.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0049.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0048.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0037.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0037.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0036.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0036.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0033.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0026.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0052.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0050.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0049.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0038.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0038.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0037.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0037.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0034.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0027.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0053.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0051.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0050.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0039.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0039.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0038.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0038.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0035.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0028.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0054.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0052.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0051.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0040.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0040.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0039.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0039.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0036.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0029.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0055.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0053.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0052.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0041.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0041.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0040.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0040.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0037.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0030.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0056.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0054.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0053.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0042.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0042.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0041.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0041.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0038.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0031.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0057.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0055.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0054.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0043.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0043.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0042.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0042.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0039.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0032.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0058.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0056.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0055.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0044.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0044.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0043.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0043.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0040.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0033.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0059.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0057.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0056.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0045.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0045.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0044.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0044.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0041.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0034.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0060.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0058.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0057.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0046.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0046.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0045.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0045.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0042.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0035.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0061.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0059.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0058.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0047.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0047.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0046.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0046.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0043.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0036.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0062.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0060.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0059.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0048.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0048.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0047.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0047.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0044.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0037.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0063.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0061.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0060.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0049.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0049.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0048.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0048.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0045.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0038.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0064.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0062.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0061.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0050.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0050.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0049.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0049.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0046.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0039.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0065.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0063.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0062.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0051.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0051.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0050.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0050.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0047.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0040.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0066.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0064.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0063.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0052.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0052.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0051.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0051.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0048.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0041.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0067.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0065.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0064.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0053.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0053.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0052.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0052.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0049.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0042.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0068.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0066.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0065.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0054.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0054.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0053.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0053.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0050.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0043.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0069.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0067.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0066.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0055.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0055.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0054.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0054.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0051.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0044.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0070.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0068.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0067.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0056.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0056.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0055.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0055.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0052.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0045.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0071.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0069.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0068.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0057.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0057.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0056.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0056.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0053.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0046.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0072.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0070.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0069.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0058.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0058.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0057.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0057.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0054.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0047.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0073.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0071.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0070.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0059.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0059.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0058.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0058.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0055.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0048.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0074.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0072.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0071.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0060.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0060.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0059.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0059.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0056.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0049.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0075.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0073.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0072.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0061.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0061.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0060.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0060.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0057.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0050.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0076.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0074.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0073.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0062.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0062.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0061.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0061.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0058.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0051.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0077.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0075.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0074.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0063.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0063.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0062.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0062.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0059.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0052.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0078.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0076.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0075.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0064.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0064.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0063.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0063.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0060.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0053.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0079.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0077.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0076.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0065.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0065.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0064.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0064.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0061.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0054.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0080.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0078.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0077.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0066.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0066.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0065.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0065.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0062.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0055.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0081.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0079.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0078.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0067.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0067.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0066.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0066.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0063.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0056.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0082.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0080.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0079.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0068.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0068.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0067.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0067.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0064.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0057.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0083.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0081.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0080.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0069.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0069.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0068.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0068.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0065.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0058.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0084.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0082.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0081.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0070.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0070.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0069.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0069.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0066.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0059.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0085.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0083.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0082.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0071.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0071.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0070.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0070.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0067.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0060.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0086.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0084.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0083.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0072.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0072.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0071.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0071.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0068.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0061.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0087.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0085.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0084.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0073.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0073.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0072.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0072.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0069.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0062.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0088.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0086.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0085.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0074.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0074.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0073.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0073.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0070.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0063.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0089.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0087.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0086.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0075.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0075.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0074.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0074.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0071.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0064.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0090.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0088.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0087.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0076.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0076.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0075.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0075.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0072.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0065.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0091.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0089.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0088.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0077.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0077.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0076.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0076.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0073.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0066.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0092.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0090.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0089.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0078.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0078.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0077.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0077.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0074.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0067.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0093.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0091.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0090.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0079.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0079.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0078.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0078.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0075.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0068.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0094.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0092.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0091.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0080.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0080.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0079.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0079.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0076.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0069.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0095.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0093.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0092.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0081.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0081.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0080.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0080.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0077.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0070.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0096.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0094.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0093.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0082.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0082.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0081.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0081.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0078.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0071.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0097.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0095.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0094.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0083.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0083.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0082.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0082.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0079.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0072.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0098.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0096.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0095.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0084.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0084.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0083.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0083.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0080.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0073.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0099.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0097.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0096.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0085.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0085.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0084.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0084.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0081.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0074.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0100.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0098.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0097.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0086.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0086.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0085.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0085.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0082.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0075.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0101.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0099.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0098.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I couldn't work around it : / Anyway, as far as I understamd the code, my fixes are necessary to make it work on any 64-bit VM linking with a 64-bit JNI library. But my Mac is the only 64-bit box I have around. ~/= Marius -- We are Elektropeople for a better living. From shahbaz_khalid at hotmail.com Wed Jun 18 06:02:55 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Wed, 18 Jun 2008 07:02:55 -0500 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Message-ID: Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/6a189377/attachment-0087.html From mpallmann at diamondtechnologies.com Wed Jun 18 06:17:56 2008 From: mpallmann at diamondtechnologies.com (Pallmann, Matthew) Date: Wed, 18 Jun 2008 08:17:56 -0400 Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: We are using the current release on Vista with no problems. The devices we are using either use a propietary cable or IR dongle. We did not need to recompile for Vista. What sort of trouble are you having? Matthew J. Pallmann Consultant Diamond Technologies ________________________________ From: rxtx-bounces at qbang.org [rxtx-bounces at qbang.org] On Behalf Of Shahbaz Khalid [shahbaz_khalid at hotmail.com] Sent: Wednesday, June 18, 2008 8:02 AM To: rxtx at qbang.org Subject: [Rxtx] Vista Support - Please! (yes I did the search first) Hello All, We are trying to build a cross platform application that can communicate with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how do we compile it for Vista 32/64 Bit platforms? There have been a few messages about Vista support and it looks like Trent Jarvi has taken it upon himself to produce a working version on Vista back in April http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I don't know what has become of it. Anyone out there who's been successful in compiling this for Vista? Getting a bit desperate. Thanks ________________________________ The i?m Talkathon starts 6/24/08. For now, give amongst yourselves. Learn More This e-mail may contain information that is privileged, confidential and exempt from applicable law. This e-mail is intended to be reviewed only by the individual(s) to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this e-mail from your system. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080618/85c593d3/attachment-0087.html From tjarvi at qbang.org Wed Jun 18 20:11:56 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Jun 2008 20:11:56 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! (yes I did the search first) In-Reply-To: References: Message-ID: On Wed, 18 Jun 2008, Shahbaz Khalid wrote: > > Hello All, > > We are trying to build a cross platform application that can communicate > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > do we compile it for Vista 32/64 Bit platforms? There have been a few > messages about Vista support and it looks like Trent Jarvi has taken it > upon himself to produce a working version on Vista back in April > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > don't know what has become of it. > > Anyone out there who's been successful in compiling this for Vista? > Getting a bit desperate. > I ran some tests at work and vista 32 appeared to be no problem as is. I'm working on 64 bit versions. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Thu Jun 19 06:09:06 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 19 Jun 2008 08:09:06 -0400 Subject: [Rxtx] parallel port Message-ID: Hi All, has anyone tried using the USB-Printer port cables with RXTX? I was thinking of driving an external device (not a printer) with the parallel port from a mac. Thanks! - Doug From shahbaz_khalid at hotmail.com Thu Jun 19 06:17:41 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:17:41 -0500 Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: Thanks a lot Trent - have you any idea if you will be done with this in about 2-3 weeks? Cheers> Date: Wed, 18 Jun 2008 20:11:56 -0600> From: tjarvi at qbang.org> To: shahbaz_khalid at hotmail.com> CC: rxtx at qbang.org> Subject: Re: [Rxtx] Vista Support - Please! (yes I did the search first)> > On Wed, 18 Jun 2008, Shahbaz Khalid wrote:> > >> > Hello All,> >> > We are trying to build a cross platform application that can communicate > > with an USB-Serial adapter. So far RXTX works on Windows XP SP2. But how > > do we compile it for Vista 32/64 Bit platforms? There have been a few > > messages about Vista support and it looks like Trent Jarvi has taken it > > upon himself to produce a working version on Vista back in April > > http://mailman.qbang.org/pipermail/rxtx/2008-April/2427474.html . But I > > don't know what has become of it.> >> > Anyone out there who's been successful in compiling this for Vista? > > Getting a bit desperate.> >> > I ran some tests at work and vista 32 appeared to be no problem as is.> > I'm working on 64 bit versions.> > --> Trent Jarvi> tjarvi at qbang.org _________________________________________________________________ The i?m Talkathon starts 6/24/08.? For now, give amongst yourselves. http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/09024290/attachment-0086.html From shahbaz_khalid at hotmail.com Thu Jun 19 06:51:21 2008 From: shahbaz_khalid at hotmail.com (Shahbaz Khalid) Date: Thu, 19 Jun 2008 07:51:21 -0500 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter Message-ID: Hello All, We are trying to communicate with a custom USB-Serial adapter device (through com ports) - works with the prolific 2303 driver (there is already an old Visual C++ application that can communicate with this device, and we are porting it). Well, we've followed the communications protocol of the device right down the minute details, but as compared to the old version of the visual c++ application (which is using memory mapped files to communicate with the device), the java rxtx version is horribly slow. We initially tried to use the strategy here (obviously customising the code so that we do the send/receive ACK protocol required by the device, by reading from the port input stream as well): http://java.sun.com/developer/releases/javacomm/SimpleWrite.java Well, this did not work at all and the device just hanged all the time and we got stuck waiting to read from the stream. Then we had to use the following code. The only problem is that the communications function is a good 2 minutes slower than it's visual c++ application counterpart (original application takes like 20 seconds): I have a hunch it's due to the SerialPortEventListener artificial delays since its a thread? Also, we downloaded the latest win32 rxtx from here ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip . Any help would be appreciated - thanks ----------------------------------- public class ReadTEST implements SerialPortEventListener { String response; CommPortIdentifier portId; InputStream inputStream; OutputStream outputStream; SerialPort serialPort; boolean dataReaded = false; Logger log = Logger.getLogger(ReadTEST.class); public void read() { connect(); try { outputStream.write("$CRNM,1".getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); outputStream.write("$RCRS,1".getBytes()); char nullchar='\0'; while (!dataReaded) { } dataReaded = false; log.debug(response); for (int i = 0; i < 18; i++) { log.debug("Hole Number=" + i); byte[] command2 = ("$HOLE," + (i+1)+nullchar).getBytes(); log.debug("Command being setn: " + new String(command2)); outputStream.write(command2); while (!dataReaded) { } dataReaded = false; log.debug(response); String returnedCmd[] = response.split(","); for (int k = 0; k < 7; k++) { String st=("$PINT,0" + (k + 1) + ",0.0000,0.0000"); log.debug("Command for PINT " + (k+1)); outputStream.write(st.getBytes()); dataReaded = false; log.debug(response); } } outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public void write() { connect(); try { outputStream.write(("$NCRS,NEW-COURSE_3,4,018").getBytes()); while (!dataReaded) { } dataReaded = false; log.debug(response); char nullchar='\n'; for (int i = 0; i < 18; i++) { log.debug("Hole Nummber=" + (i + 1)); outputStream.write(("$HOLE," + (i + 1) + nullchar).getBytes()); while (!dataReaded) { } for (int j = 0; j < 7; j++) { log.debug("Point Nummber=" + (j + 1)); outputStream .write(("$PINT,0" + (j + 1) + ",11.21,32.201,FRONT") .getBytes()); outputStream.flush(); while (!dataReaded) { } dataReaded = false; log.debug(response); } } outputStream.write(("$WCRS"+nullchar).getBytes()); while (!dataReaded) { } dataReaded = false; outputStream.write("$EXIT".getBytes()); while (!dataReaded) { } log.debug(response); destroyConnection(true); log.debug("Exit From Application"); } catch (IOException e) { e.printStackTrace(); } } public boolean connect() { if (portExists()) { try { serialPort = (SerialPort) portId.open("", 57600); } catch (PortInUseException e1) { e1.printStackTrace(); } try { serialPort.setDTR(false); serialPort.setRTS(false); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { } try { serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } catch (Exception e) { log.debug("Error setting event notification"); log.debug(e.toString()); System.exit(-1); } try { char nullchar ='\0'; outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); outputStream.write(("$FCON"+nullchar).getBytes()); outputStream.flush(); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase("$OKCN")) { log.debug("Response" + response); } } catch (IOException e) { e.printStackTrace(); } } return false; } public boolean portExists() { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM3")) { log.debug("Found port: " + "COM3"); return true; } } } log.debug("Port Does Not Exist"); return false; } public static void main(String[] args) { new ReadTEST().write(); } public void serialEvent(SerialPortEvent event) { log.debug(event.toString()); switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { response = ""; int result = -1; byte temp[] = new byte[256]; inputStream.read(temp); while((result=inputStream.read(temp)) > 0){ } response = new String(temp); dataReaded = true; } catch (IOException e) { } break; } } public boolean destroyConnection(boolean forceFully) { try { log.debug("Connection is closed"); outputStream.write((Protocol.EXIT).getBytes()); do { } while (!dataReaded); dataReaded = false; if (response != null && response.equalsIgnoreCase(Protocol.OKEX)) { log.debug("Course Name:" + response); inputStream.close(); outputStream.close(); serialPort.close(); dataReaded = false; return true; } } catch (IOException e) { e.printStackTrace(); } return false; } } ---------------------------------------- _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080619/2f30b367/attachment-0086.html From michael.erskine at ketech.com Thu Jun 19 10:02:18 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:02:18 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Shahbaz Khalid > Subject: [Rxtx] Dead slow communications with a USB-Serial adapter I can't begin to list all the problems with the posted code... OK I will :) The first thing we do is connect - let's assume COM3 exists and portExists() sets up portId and returns true... > public boolean connect() { > if (portExists()) { > try { > serialPort = (SerialPort) portId.open("", 57600); > } catch (PortInUseException e1) { > e1.printStackTrace(); > } > try { > > serialPort.setDTR(false); > serialPort.setRTS(false); > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) { > } We've got exception handlers that are blank and running on into other areas of code: that may be fine but without any logging, how can we know they're not occurring? The port open call is going to wait for 57600 milliseconds if it finds the port already open. The DTR and RTS lines are being reset but we don't have any specific flow control being applied to the port object. Do we know what flow control is expected by the device? Is the RS3232 cable fully populated or does it loop back the handshaking lines? I'll stop there as I've got a job to finish but, seriously, there's a lot of potential problems there. Regards, Michael Erskine. From michael.erskine at ketech.com Thu Jun 19 10:32:51 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 19 Jun 2008 17:32:51 +0100 Subject: [Rxtx] Dead slow communications with a USB-Serial adapter In-Reply-To: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D431C123C941@no-sv-03.ketech.local> Message-ID: <06BA3262D918014F9183B66425D5A8D431C123C949@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Michael Erskine > Sent: 19 June 2008 17:02 > Subject: Re: [Rxtx] Dead slow communications with a USB-Serial adapter > I can't begin to list all the problems with the posted code... OK I will > :) I don't mean to slate the code but it gets more interesting :) I don't think that an event listening thread is appropriate for this application especially since it appears that a pseudo half-duplex type "chat" is desired. That aside, when we look at the event handler we see that if there's multiple reads then the data in temp[] will be clobbered... > public void serialEvent(SerialPortEvent event) { > log.debug(event.toString()); > > > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > try { > response = ""; > > int result = -1; > > byte temp[] = new byte[256]; > inputStream.read(temp); > while((result=inputStream.read(temp)) > 0){ > > } > > response = new String(temp); > dataReaded = true; > } catch (IOException e) { > } > break; > } > } Just a thought while I'm looking at it. Regards, Michael Erskine. From tjarvi at qbang.org Thu Jun 19 18:58:28 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 18:58:28 -0600 (MDT) Subject: [Rxtx] parallel port In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Dr. Douglas Lyon wrote: > Hi All, > has anyone tried using the USB-Printer port > cables with RXTX? > > I was thinking of driving an external device (not a printer) > with the parallel port from a mac. > Hi Doug, The Parallel port code needs work - especially for Mac. I think it will work (rx and tx) on Linux and w32. I doubt Mac will enumerate the ports. We don't bang raw addresses or anything so it should be possible once the ports are enumerated. The code is actually very simple when you get in there. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Jun 19 19:17:08 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jun 2008 19:17:08 -0600 (MDT) Subject: [Rxtx] Vista Support - Please! In-Reply-To: References: Message-ID: On Thu, 19 Jun 2008, Shahbaz Khalid wrote: > > Thanks a lot Trent - have you any idea if you will be done with this in > about 2-3 weeks? > We will have something up in 2-3 weeks but it may not be the final something. There will be prereleases until everyone is happy which isnt predictable. -- Trent Jarvi tjarvi at mathworks.com From elettrozero at hotmail.it Sat Jun 21 13:35:55 2008 From: elettrozero at hotmail.it (Luigi Ermini) Date: Sat, 21 Jun 2008 21:35:55 +0200 Subject: [Rxtx] X64 version for windows Message-ID: Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. So, why not compile RxTX ? :D Seriusly, I would get a x64 version of RxTx native: where I start? Thanks, elettrozero. _________________________________________________________________ Scarica Windows Live, un mondo di programmi per te! http://get.live.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080621/75ca477a/attachment-0083.html From tjarvi at qbang.org Sun Jun 22 20:38:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Jun 2008 20:38:42 -0600 (MDT) Subject: [Rxtx] X64 version for windows In-Reply-To: References: Message-ID: On Sat, 21 Jun 2008, Luigi Ermini wrote: > Hi all, I recently installed Windows Vista 64bit on my AMD64 and I've been compiling libraries in x64 for all the week. > So, why not compile RxTX ? :D > Seriusly, I would get a x64 version of RxTx native: where I start? > > Thanks, elettrozero. > Install mingw64 gcc as well as the other required tools like make, sed and awk and then try to update the makefile. You will need to update the symbols file or update the makefile to use newer tools from mingw64 to handle the symbol exports. It isn't as easy as many builds. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Jun 23 02:38:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 23 Jun 2008 04:38:59 -0400 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: <71537629-ED02-47EC-A32B-6530F87D2315@sympatico.ca> Hi, Looking at the linker errors it would seem that the libraries you are trying to link with don't have x86 64 bit support. When in doubt you can always use the 'file' command to see what architectures a framework or library has. For example: file /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// CoreFoundation.framework/CoreFoundation What errors do you get when you try using the 10.5 SDK? Unfortunately I only have a Core Duo, so I don't have access to JDK 1.6, which at this point in time requires a 64-bit Intel processor, so I can't be of too much help. Andre On 12-Jun-08, at 08:26 , Zach Shelby wrote: > Marius, > > Thanks for the patch. I was successful in applying this patch also to > the 2.1-7r2 source with x86_64 added to the Makefile flags. This works > successfully with 10.5.3 JRE1.6, great! > > I was unsuccessful in getting x86_64 working with the CVS source. > There > are some problems with x86_64 and IOKit.framework when you try to > compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, > but > changing to 10.5 didn't help either. > > -- > > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > CoreFoundation.framework/CoreFoundation, > missing required architecture x86_64 in file > ld: warning in > /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks// > IOKit.framework/IOKit, > missing required architecture x86_64 in file > Undefined symbols for architecture x86_64: > "___CFConstantStringClassReference", referenced from: > __cfstring at 0 in SerialImp.o > __cfstring at 0 in SerialImp.o > "_CFStringCreateWithCString", referenced from: > _getRegistryString in SerialImp.o > "_CFDictionarySetValue", referenced from: > _createSerialIterator in SerialImp.o > "_IOServiceMatching", referenced from: > _createSerialIterator in SerialImp.o > "_IOMasterPort", referenced from: > _createSerialIterator in SerialImp.o > "_CFRelease", referenced from: > _getRegistryString in SerialImp.o > "_kCFAllocatorDefault", referenced from: > _getRegistryString in SerialImp.o > "_select$1050", referenced from: > _read_byte_array in SerialImp.o > _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o > "_IOIteratorNext", referenced from: > _registerKnownSerialPorts in SerialImp.o > "_CFStringGetCString", referenced from: > _getRegistryString in SerialImp.o > "_IORegistryEntryCreateCFProperty", referenced from: > _getRegistryString in SerialImp.o > "_IOServiceGetMatchingServices", referenced from: > _createSerialIterator in SerialImp.o > ld: symbol(s) not found for architecture x86_64 > > -- > > Marius Kintel wrote: >> Hi, >> >> I just looked into this, and found a bug in rxtx causing the "Invalid >> memory access of location" reported by Zach. >> I wrote a quick and dirty fix for this (see attachment). The fix is a >> corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" >> variable), but in the native code. >> >> The attached diff is against the commapi-0-0-1 branch. >> To build it in 64-bit mode on Mac OS X, you still need to patch the >> makefile as described by Zach. >> >> ~/= Marius >> >> -- >> We are Elektropeople for a better living. >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > -- > Zach Shelby | Head of Research | +358 40 7796297 > Sensinode Ltd. www.sensinode.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cyrille.dumont at tatexpress.fr Mon Jun 23 10:45:46 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 23 Jun 2008 18:45:46 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF Message-ID: <485FD33A.8050004@tatexpress.fr> Hi All, I'm using, for a project, a thermal printer (UBI501 : 9600/N/8/1/XonXoff) in order to print stickers. When I print a sticker, the printing result is available on the com port. When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" but when I use Java(via rxtx : the same param, as the UBI501, is used), I've "#13#15#31#30#32#32" (# : hexa) I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my printing result. Is it normal to find XON/XOFF characters on the Inputstream, even if XonXoff flow ctrl is activated? (I never find them with C++) A way to deal with them ? Thanks in advance. Best regards Cyrille. PS : I'm using Rxtx v.2.1 From tjarvi at qbang.org Mon Jun 23 16:48:21 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Jun 2008 16:48:21 -0600 (MDT) Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: <485FD33A.8050004@tatexpress.fr> References: <485FD33A.8050004@tatexpress.fr> Message-ID: On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > Hi All, > > I'm using, for a project, a thermal printer (UBI501 : > 9600/N/8/1/XonXoff) in order to print stickers. > When I print a sticker, the printing result is available on the com port. > > When I use C++ to read on the com port, I've, for ex., "#15#31#30#32#32" > but when I use Java(via rxtx : the same param, as the UBI501, is used), > I've "#13#15#31#30#32#32" > (# : hexa) > > I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my > printing result. > Is it normal to find XON/XOFF characters on the Inputstream, even if > XonXoff flow ctrl is activated? > (I never find them with C++) > A way to deal with them ? > > Thanks in advance. > Best regards > > Cyrille. > Hi Crylle: Sounds like we are doing something wrong. What OS are you using? What is the java code in a simple test case? What is the corresponding C++ code? -- Trent Jarvi tjarvi at qbang.org From cyrille.dumont at tatexpress.fr Tue Jun 24 02:56:33 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 10:56:33 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860B6C1.2060102@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Cyrille DUMONT Analyste Programmeur Departement des Systemes d'Information (DSI) Tatex - TOURS E-mail : te_sitx_dev at tatexpress.fr Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From cyrille.dumont at tatexpress.fr Tue Jun 24 03:11:25 2008 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 24 Jun 2008 11:11:25 +0200 Subject: [Rxtx] Problem with flow ctrl XON/XOFF In-Reply-To: References: <485FD33A.8050004@tatexpress.fr> Message-ID: <4860BA3D.3010609@tatexpress.fr> Hi, OS: Windows XP Rxtx: v2.1 Java: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1"); SerialPort sPort = (SerialPort)portId.open("TEST", 30000); //-- 9600/N/8/1/XonXoff sPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); OutputStream os = sPort.getOutputStream(); InputStream is = sPort.getInputStream(); //-- Send N data to the Printer os.write(sDataOut.getBytes()); .... //-- Read printing result StringBuffer inputBuffer = new StringBuffer(); do { for (int newData = is.read(); newData != -1; newData = is.read()) { inputBuffer.append((char) newData); } try {Thread.sleep(250);} catch (InterruptedException ex) {} } while (inputBuffer.length() <= 0); sDataIn = inputBuffer.toString(); // => sDataIn: "#13#15#31#30#32#32" (Xoff) C++: A little difficult to get code (not an application of mine). I only know what is written and what is receaved (no Xon/Xoff char) Python (use library "pyserial" ; same result as C++): #-- 9600/N/8/1/XonXoff mySerial = serial.Serial( \ port = 0, \ baudrate = 9600, \ bytesize = 8, \ parity = 'N', \ stopbits = 1, \ timeout = 20, \ xonxoff = 1, \ rtscts = 0) bPortOpen = mySerial.isOpen() #-- Send N data to the Printer mySerial.write(sDataOut) ... #-- Read printing result sDataIn = mySerial.read(10) #--> sDataIn: "#15#31#30#32#32" (no Xoff) Thanks in advance Best regards. Cyrille. Trent Jarvi a ?crit : > On Mon, 23 Jun 2008, Cyrille DUMONT wrote: > >> Hi All, >> >> I'm using, for a project, a thermal printer (UBI501 : >> 9600/N/8/1/XonXoff) in order to print stickers. >> When I print a sticker, the printing result is available on the com >> port. >> >> When I use C++ to read on the com port, I've, for ex., >> "#15#31#30#32#32" >> but when I use Java(via rxtx : the same param, as the UBI501, is used), >> I've "#13#15#31#30#32#32" >> (# : hexa) >> >> I always find '#13' (DC3 / XOFF) & '#11' (DC1 / XON) characters with my >> printing result. >> Is it normal to find XON/XOFF characters on the Inputstream, even if >> XonXoff flow ctrl is activated? >> (I never find them with C++) >> A way to deal with them ? >> >> Thanks in advance. >> Best regards >> >> Cyrille. >> > > Hi Crylle: > > Sounds like we are doing something wrong. > > What OS are you using? > What is the java code in a simple test case? > What is the corresponding C++ code? > > -- > Trent Jarvi > tjarvi at qbang.org > From rogier at vanderhee.net Wed Jun 25 04:21:18 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 12:21:18 +0200 Subject: [Rxtx] How to handle hardware device disconnect Message-ID: <48621C1E.3080206@vanderhee.net> Hi, I have a FTDI chip for USB->Serial port events, works like a charm. I use the event based listening interface. But how do I handle a hardware disconnected, if a user just pulls the USB cable from the PC? I know that I get an IOException "No error in readByte" when that happens. But how do uninitialize the device properly then? When I do a serialPort.removeEventListener() it hangs there. When I do nothing I get a huge stream of errors: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied. When I do a serialPort.close(), the stream of erros stops, but my application then hangs completely.. Groet, Rogier From rogier at vanderhee.net Wed Jun 25 14:03:27 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Wed, 25 Jun 2008 22:03:27 +0200 Subject: [Rxtx] How to handle hardware device disconnect In-Reply-To: <48621C1E.3080206@vanderhee.net> References: <48621C1E.3080206@vanderhee.net> Message-ID: <4862A48F.8090500@vanderhee.net> > When I do a serialPort.close(), the stream of erros stops, but my > application then hangs completely.. > > Some more extensive googling gave me the answer: the removeEventListener() and close() cannot be made in the same thread as in which the IOException occured. Just launch a new thread with these two calls and it now works perfectly... Groet, Rogier From pboulton at pulsetracer.com Wed Jun 25 18:03:06 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Wed, 25 Jun 2008 17:03:06 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device Message-ID: <4862DCBA.2020901@pulsetracer.com> Environment: Windows XP Professional, Version 2002, Service Pack 3 Rxtx: 2.1-7r2 USB Serial Port, driver provided by FTDI, version 2.4.6.0. On the other end of the serial port is an FTDI FT232R chipset, driven by a microcontroller. I am able to use Hyperterminal to successfully open a two-way terminal session via that USB serial port. When I use the following Java code, no exceptions are seen, but the connection does not do anything -- i.e., no SerialPortEvents are seen, and I note that on the FT232R the signal RTS remains high. try { CommPortIdentifier portId =CommPortIdentifier.getPortIdentifier(whichPort); serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); try { serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { feedback = "Could not set speed."; System.out.println("can't set params"); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); if (parent != null){ serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } } catch (IOException e) { feedback = "Serial Stream Problem"; System.out.println("couldn't get streams"); } } catch (Exception e) { feedback = "Port " + whichPort + " in use"; System.out.println("Port " + whichPort + " in Use " + e); } Stepping through the above code, the condition that (parent != null) is met, so the calls of interest to the RXTXPort methods are: serialPort =(SerialPort) portId.open("SerialServer " + whichPort, 2000); serialPort.setSerialPortParams(whichSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); When I open Hyperterminal, select the COM port and click Connect, the F232R signal RTS correctly goes low. And, as I said, two-way communications occur. I asked FTDI about this, and they said that their Virtual COM Port interface is the same as a legacy com port, and that is how tools like HyperTerminal work with the driver. Can anybody explain what I'm doing differently from Hyperterminal, and what I'm missing to get successful communications with this USB Serial port? Thanks very much. Philip Boulton From pboulton at pulsetracer.com Thu Jun 26 13:53:02 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Thu, 26 Jun 2008 12:53:02 -0700 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <486340E8.6000709@vanderhee.net> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> Message-ID: <4863F39E.4060206@pulsetracer.com> Thanks Rogier. I am wondering a few things: Firstly, what is the method getDriver() that you're invoking? Secondly, testRead() is a private member in my version of rxtx. Are you editing and recompiling it? I'm just using the .jar files, and the rxtxserial.dll Thirdly, are you working in a Windows environment? In answer to your question about how I detect which COM port the device is on, the answer is that the user (me) selects the port from a drop-down list of available serial ports, which is populated at startup time as follows: public ArrayList getPortsList() { ArrayList ports = new ArrayList(); CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println("Get List"); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { String[] portAndOwner = { portId.getName(), portId.getCurrentOwner()}; ports.add(portAndOwner); System.out.println( "Serial Listing: " + portId.getName() + " " + portId.getCurrentOwner()); } } return ports; } In general, I don't know how -- within the confines of Java and rxtxserial and the Windows VCP drivers from FTDI that I have installed -- to determine that this port is in fact an FTDI USB--Serial converter, read the device ID, etc. If you install FTDI's D2XX drivers, I think it is quite easy. But, in the interests of making the product work for non-Windows platforms, we have restricted ourselves to the VCP. ---------------- Philip B. Rogier van der Hee wrote: > Philip Boulton wrote: >> Environment: >> >> Windows XP Professional, Version 2002, Service Pack 3 >> Rxtx: 2.1-7r2 >> USB Serial Port, driver provided by FTDI, version 2.4.6.0. >> >> On the other end of the serial port is an FTDI FT232R chipset, driven >> by a microcontroller. >> >> I am able to use Hyperterminal to successfully open a two-way >> terminal session via that USB serial port. >> >> When I use the following Java code, no exceptions are seen, but the >> connection does not do anything -- i.e., no SerialPortEvents are >> seen, and I note that on the FT232R the signal RTS remains high. >> try { >> CommPortIdentifier portId >> =CommPortIdentifier.getPortIdentifier(whichPort); >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> try { >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } >> catch (UnsupportedCommOperationException e) { >> feedback = "Could not set speed."; >> System.out.println("can't set params"); >> } >> try { >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> if (parent != null){ >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> } >> } >> catch (IOException e) { >> feedback = "Serial Stream Problem"; >> System.out.println("couldn't get streams"); >> } >> >> } >> catch (Exception e) { >> feedback = "Port " + whichPort + " in use"; >> System.out.println("Port " + whichPort + " in Use " + e); >> } >> >> Stepping through the above code, the condition that (parent != null) >> is met, so the calls of interest to the RXTXPort methods are: >> >> serialPort =(SerialPort) portId.open("SerialServer " + >> whichPort, 2000); >> serialPort.setSerialPortParams(whichSpeed, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); >> in = serialPort.getInputStream(); >> out = serialPort.getOutputStream(); >> serialPort.addEventListener(this); >> serialPort.notifyOnDataAvailable(true); >> >> > Hi Philip, looks good to me. I have exactly the same device from FTDI > and I use this to connect to it: > > commName is like COM12 or something, depends on USB port and such. > > if (RXTXCommDriver.testRead(commName, > CommPortIdentifier.PORT_SERIAL)) { > serialPort = (SerialPort) > CommPortIdentifier.getDriver().getCommPort(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL); > if (serialPort != null) { > CommPortIdentifier.addPortName(commName.toUpperCase(), > CommPortIdentifier.PORT_SERIAL, > CommPortIdentifier.getDriver()); > portIdentifier = > CommPortIdentifier.getPortIdentifier(commName.toUpperCase()); > } > } > serialPort.setSerialPortParams(device.getBaudRate(), > device.getDataBits(), device.getStopBits(), device.getParity()); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > > How do you detect which COM port the device is on? > > Groet > > Rogier > From lewlinn at telstra.com Sat Jun 28 19:57:36 2008 From: lewlinn at telstra.com (Lew L) Date: Sun, 29 Jun 2008 11:57:36 +1000 Subject: [Rxtx] dev/ttyX & dev/serialx Message-ID: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Hi all, I am using Windows and ititially just want to receive NMEA data from a gps. I have hacked around the Contribs>SimpleRead.java sample and am reading in nmea sentence data to the dos screen. So I'm happy I'm on the right track. I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java sets up as dev/serialx. ## These appear to be different methods of setting up the serial port , are they used for different application? Thanks ! Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080629/421ee939/attachment-0076.html From rogier at vanderhee.net Sun Jun 29 05:29:22 2008 From: rogier at vanderhee.net (Rogier van der Hee) Date: Sun, 29 Jun 2008 13:29:22 +0200 Subject: [Rxtx] Failed connection to FTDI R232 device In-Reply-To: <4863F39E.4060206@pulsetracer.com> References: <4862DCBA.2020901@pulsetracer.com> <486340E8.6000709@vanderhee.net> <4863F39E.4060206@pulsetracer.com> Message-ID: <48677212.8060301@vanderhee.net> Philip Boulton wrote: > Thanks Rogier. > > I am wondering a few things: > > Firstly, what is the method getDriver() that you're invoking? > Secondly, testRead() is a private member in my version of rxtx. Are > you editing and recompiling it? I'm just using the .jar files, and > the rxtxserial.dll > Yes, I use a special copy that someone posted on a Sun Java forum. I was having trouble with the portIdentifier when reconnecting a device after I disconnected it, as if it was never released. This code prevents the problem with that. On forums I have seen multiple people having this problem, you might not have run into it. My PC crashed and I unfortunately can't find the link anymore. But I can send this version to you if you want. > Thirdly, are you working in a Windows environment? > Yes, but I'm planning to move to a Linux / Mac OS X environment too, in time. I tested my FT232R device with both platforms using simple hyperterminal like programs, which worked out of the box. > In answer to your question about how I detect which COM port the > device is on, the answer is that the user (me) selects the port from a > drop-down list of available serial ports, which is populated at > startup time as follows: > > public ArrayList getPortsList() { > ArrayList ports = new ArrayList(); > CommPortIdentifier portId; > Enumeration portList = > CommPortIdentifier.getPortIdentifiers(); > System.out.println("Get List"); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > String[] portAndOwner = > { portId.getName(), portId.getCurrentOwner()}; > ports.add(portAndOwner); > System.out.println( > "Serial Listing: " > + portId.getName() > + " " > + portId.getCurrentOwner()); > } > } > return ports; > } > > In general, I don't know how -- within the confines of Java and > rxtxserial and the Windows VCP drivers from FTDI that I have installed > -- to determine that this port is in fact an FTDI USB--Serial > converter, read the device ID, etc. If you install FTDI's D2XX > drivers, I think it is quite easy. But, in the interests of making > the product work for non-Windows platforms, we have restricted > ourselves to the VCP. > > Sorry, but I was wondering if you would have found another way :-) . FTDI released a new driver version back in May with a new call FT_GetCOMPort function. You have native Java wrappers for it, I'm using Mike Werner's implementation: http://sourceforge.net/projects/ftd2xxj. In a seperate polling thread I used ftd2xxj library to detect new FT232R devices and find the COM port for it. That is very easy now: @Override public List availableDevices() throws Exception { Device[] currentDevices = null; synchronized (lock) { try { // we are only interested in 232R types currentDevices = Service.listDevicesByType(DeviceType.FT_DEVICE_232R); } catch (FTD2xxException e) { // this argument is thrown when no device is available, just plain stupid // "device was not found" } catch (IllegalArgumentException e) { // this argument is thrown when no device is available, just plain stupid } if (currentDevices != null) { // check if all current devices are still listed for (int i = 0; i < devices.size(); ++i) { if (!deviceAvailable(devices.get(i).getName(), currentDevices)) { devices.remove(devices.get(i)); } } // now add the new devices for (int i = 0; i < currentDevices.length; ++i) { if (!deviceListed(currentDevices[i].getDeviceDescriptor().getProductDescription())) { currentDevices[i].open(); long comPortNumber = currentDevices[i].getPort().getCOMPortNumber(); String comPortName = "COM" + comPortNumber; devices.add(new SerialPortDevice(currentDevices[i].getDeviceDescriptor().getProductDescription(), comPortName)); } } } } return devices; } Unfortunately, it has not been updated in a while and I added this function and some other new functions to it. There are still some issues with it and I'm trying to get into contact with Mike to finish it and release a new version but he seems very busy. I just recompiled it for Windows, but Linux was already there and Mac OS X should not be a big problem. FTDI has library versions for a LOT of platforms so their side is not an issue. If you want, I can send this also to you. Groet, Rogier From ajmas at sympatico.ca Sun Jun 29 07:23:27 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 29 Jun 2008 09:23:27 -0400 Subject: [Rxtx] dev/ttyX & dev/serialx In-Reply-To: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> References: <003301c8d98b$84b8bc40$0100000a@ll35e1d2095fc2> Message-ID: <2580C8B4-CBEC-4AD2-91F4-E408AFA0D0C1@sympatico.ca> Hi, They are both essentially the same. Depending on what Unix based system you are on, the serial port will have a name which is a bit more descriptive or simply a generic 'tty' prefixed name. Andre On 28-Jun-08, at 21:57 , Lew L wrote: > Hi all, > > I am using Windows and ititially just want to receive NMEA data > from a gps. > > I have hacked around the Contribs>SimpleRead.java sample and am > reading in nmea sentence data to > the dos screen. So I'm happy I'm on the right track. > > I noticed that Contribs>SimpleRead.java uses dev/ttyX and Test.java > sets up > as dev/serialx. > > ## These appear to be different methods of setting up the serial > port , are > they used for different application? > > Thanks ! > Lew > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From pl78 at katamail.com Tue Jun 3 08:31:37 2008 From: pl78 at katamail.com (Paolo) Date: Tue, 03 Jun 2008 16:31:37 +0200 Subject: [Rxtx] Timeout error with serialjava Message-ID: <484555C9.8080900@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080603/51da3ec9/attachment-0102.html From tjarvi at qbang.org Tue Jun 3 21:00:36 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Jun 2008 21:00:36 -0600 (MDT) Subject: [Rxtx] Timeout error with serialjava In-Reply-To: <484555C9.8080900@katamail.com> References: <484555C9.8080900@katamail.com> Message-ID: On Tue, 3 Jun 2008, Paolo wrote: > While run serialjava.py of pyserial i receive this error: > > File "/home/maverick/workspace/Test/src/serialjava.py", line 103, in > __init__ > TypeError: enableReceiveTimeout(): 1st arg can't be coerced to int > Experimental:? JNI_OnLoad called. > > 101 self.timeout = timeout > 102 if timeout >= 0: > 103 ????????? self.sPort.enableReceiveTimeout(timeout*1000) > > Help me, thanks. > Hi Paolo, This appears to be an issue with the Python wrapper. I would try contacting the author(s) of that package if they do not respond here. wild guess.. You may make sure you are not using a timeout*1000 thats larger than an int. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Thu Jun 5 08:45:46 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 5 Jun 2008 16:45:46 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib Message-ID: Hi, I just looked into this, and found a bug in rxtx causing the "Invalid memory access of location" reported by Zach. I wrote a quick and dirty fix for this (see attachment). The fix is a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" variable), but in the native code. The attached diff is against the commapi-0-0-1 branch. To build it in 64-bit mode on Mac OS X, you still need to patch the makefile as described by Zach. ~/= Marius -- We are Elektropeople for a better living. -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20080605/37b7473f/attachment-0100.obj -------------- next part -------------- From lyon at docjava.com Fri Jun 6 03:23:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 06 Jun 2008 05:23:17 -0400 Subject: [Rxtx] dtr control Message-ID: Hi All, My serial port is interfaced to a mac via a keyspan 19HS USB dongle. When I set DTR: serialPort.setDTR(false); The line changes, but the invoking thread hangs if I try to call: serialPort.setDTR(true); I can understand why their might be a delay, but why would the thread hang? Thanks! - Doug From ehjuerrens at uni-muenster.de Fri Jun 6 09:29:20 2008 From: ehjuerrens at uni-muenster.de (=?ISO-8859-1?Q?Eike_Hinderk_J=FCrrens?=) Date: Fri, 06 Jun 2008 17:29:20 +0200 Subject: [Rxtx] Problems with some Serialports using Windows In-Reply-To: References: <48401F5C.7090509@uni-muenster.de> <48453038.1080507@uni-muenster.de> Message-ID: <484957D0.2050804@uni-muenster.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Trent Jarvi schrieb: > > Hi EIke, > > You may try enabling hardware flow control on the windows systems that > are not receiving any data. The Linux kernel drivers just do the right > thing for flow control which can cover this problem until you move to > windows. As mentioned before I checked every possible flow control setting with this results: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed > Also make sure rxtx is the only application using the serial port. There are no other applications running using serial ports. > I'll try to look at your example code in the morning. Did you have time to do this? Eike > On Tue, 3 Jun 2008, Eike Hinderk J?rrens wrote: > >> Trent Jarvi schrieb: >>> Some LOC may help. >> I attached the two classes which communicate with the serial port. The >> Feeder class is a TimerTask which is periodically called. This will use >> the two other classes to retrieve the data from the station. It seems to >> me that the communication is to complex to give you only some lines. I >> hope you understand it. >> >> >>> You may look to see that you have read all the data and are not reading >>> a previous response from the device. >> How do I differ between the events? >> >> >>> Are you using events? >> Yes. I am using an eventlistener class that will be checked after >> waiting some time >> >> >>> I recall a >>> difference in the frequency of one event (data available? output buffer >>> empty?) >> In the receiving class I am checking for available data, and if not >> there will be something logged, but it isn't. This includes the output >> buffer empty stuff I think. >> >> >>> Is any flow control involved? Linux will usually just do the right >>> thing while you need to be explicit on windows. >> BAUDRATE, DATABITS, STOPBITS, PARITY are set. I will try the flow >> control settings. >> >> My Results are for flow control: >> - NONE: >> nothing changed >> >> - RTSCTS_IN: >> the lib seems to be loaded because the logs stated: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> but after that the application stopped and did no more move! >> >> - RTSCTS_OUT: >> the same situation like using RTSCTS_IN >> >> - XONOFF_IN: >> nothing changed >> >> - XONOFF_OUT: >> nothing changed >> >> Thanks for your help. >> >> Eike >> >>> On Fri, 30 May 2008, Eike Hinderk J?rrens wrote: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hello, >>>> this is my first post on this mailing list. >>>> >>>> I am using rxtx to access a home weather station (=hws) from ELV (a >>>> german company: >>>> http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=9096). >>>> >>>> >>>> I developed the software using linux and there were no problems. >>>> >>>> Now I "installed" my program on Windows XP and with some machines I >>>> have >>>> heavy problems but others doing a good job. I can not figure out the >>>> source of the problem because there are no exceptions thrown. The only >>>> problem is that the hws is not answering correctly or answering not at >>>> all to my calls. >>>> I have to activate the communication with the hws sending as often as >>>> possible a special byte pattern and wait for an ACK by the station. >>>> On the problematic windows machines I am receiving an ACK but when I >>>> send a command pattern I still receive the ACK. >>>> >>>> Do you have any idea how to narrow the problem? >>>> >>>> Do you need some LOC? >>>> >>> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFISVfQ820dQiNIWckRAsjTAJ40NeqGP9/LUTvyIegbwf72cCPyoACfUXqX JENFUze6D96TCkcudYZznJs= =9DM0 -----END PGP SIGNATURE----- From santosh.ry at gmail.com Fri Jun 6 09:59:06 2008 From: santosh.ry at gmail.com (Santosh) Date: Fri, 6 Jun 2008 11:59:06 -0400 Subject: [Rxtx] CVS connection time out Message-ID: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Hello, I'm trying to check out the latest rxtx sources but it is timing out! [root at localhost rxtx]# cvs -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 failed: Connection timed out thanks, santosh From johnny.luong at trustcommerce.com Fri Jun 6 13:53:47 2008 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 06 Jun 2008 12:53:47 -0700 Subject: [Rxtx] patch for already owned port thrown exception Message-ID: <484995CB.4090702@trustcommerce.com> Hi, Attached is a patch to the CommPortIdentifier class to try and exit out more gracefully as we see the UnsatisifiedLinkError against the CVS trunk. It looks similiar to the issue encountered here: http://mailman.qbang.org/pipermail/rxtx/2006-February/2270357.html Any thoughts? Thanks, Johnny -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CommPortIdentifier.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20080606/62b4faa3/attachment-0099.pl From tjarvi at qbang.org Fri Jun 6 19:44:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 6 Jun 2008 19:44:10 -0600 (MDT) Subject: [Rxtx] CVS connection time out In-Reply-To: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: On Fri, 6 Jun 2008, Santosh wrote: > Hello, > > I'm trying to check out the latest rxtx sources but it is timing out! > > [root at localhost rxtx]# cvs > -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > login > Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: Connection timed out > > CVS works fine from here (the server is not near on the Internet). [] $ cvs -d :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login Logging in to :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot CVS password: [] $ From santosh.ry at gmail.com Mon Jun 9 06:33:49 2008 From: santosh.ry at gmail.com (Santosh) Date: Mon, 9 Jun 2008 08:33:49 -0400 Subject: [Rxtx] CVS connection time out In-Reply-To: References: <4ec9eab60806060859r451bbaceq8c4cf19b3aca9bdb@mail.gmail.com> Message-ID: <4ec9eab60806090533m52cf206fx404331060d87b2e3@mail.gmail.com> On Fri, Jun 6, 2008 at 9:44 PM, Trent Jarvi wrote: > On Fri, 6 Jun 2008, Santosh wrote: > >> Hello, >> >> I'm trying to check out the latest rxtx sources but it is timing out! >> >> [root at localhost rxtx]# cvs >> -d:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot >> login >> Logging in to >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot >> CVS password: >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 >> failed: Connection timed out >> >> > > CVS works fine from here (the server is not near on the Internet). > > [] $ cvs -d > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot login > Logging in to > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > CVS password: > [] $ > > Hi, Yes, it works fine from my home computer. but doesn't work from my office computer. Looks like a proxy issue. thanks, santosh From santosh.ry at gmail.com Tue Jun 10 14:27:50 2008 From: santosh.ry at gmail.com (Santosh) Date: Tue, 10 Jun 2008 16:27:50 -0400 Subject: [Rxtx] which version Message-ID: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Hello, Currently we are using RXTX 2.1-7r2 (Final) in our product; with this version we are facing "USB disconnect" bug. After searching in mail list achieve I see that this has been resolved in latest sources. could you please suggest which latest beta version we should use; which is in good shape if not stable? thanks, santosh From tjarvi at qbang.org Tue Jun 10 18:30:39 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Jun 2008 18:30:39 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> Message-ID: On Tue, 10 Jun 2008, Santosh wrote: > Hello, > > Currently we are using RXTX 2.1-7r2 (Final) in our product; with this > version we are facing "USB disconnect" bug. > After searching in mail list achieve I see that this has been resolved > in latest sources. > could you please suggest which latest beta version we should use; > which is in good shape if not stable? > > thanks, santosh Hi Santosh If you don't want to compile and test from CVS, I would stick with the issues in r2 until we release -8. I expect there will be several testable releases of the latest source comming up shortly but it will take a while before we do an rxtx.org stable release. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Jun 11 19:54:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Jun 2008 19:54:18 -0600 (MDT) Subject: [Rxtx] which version In-Reply-To: <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> References: <4ec9eab60806101327k61d6a864ob116c498d285934@mail.gmail.com> <6A081E6F-A0A4-4659-8C4B-856088DDD45F@rbr-global.com> Message-ID: On Wed, 11 Jun 2008, Greg Johnson wrote: > Hi folks, > Can I offer to help with -8 at all? I hadn't heard anything about the > release, but I'd been keen to test (especially if the nebulous USB disconnect > fix is involved!) > I'm just starting to get free time again. I'll try putting a test zip file together this weekend. -- Trent Jarvi tjarvi at qbang.org From zach at sensinode.com Thu Jun 12 06:26:01 2008 From: zach at sensinode.com (Zach Shelby) Date: Thu, 12 Jun 2008 15:26:01 +0300 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: Message-ID: <485115D9.6010609@sensinode.com> Marius, Thanks for the patch. I was successful in applying this patch also to the 2.1-7r2 source with x86_64 added to the Makefile flags. This works successfully with 10.5.3 JRE1.6, great! I was unsuccessful in getting x86_64 working with the CVS source. There are some problems with x86_64 and IOKit.framework when you try to compile ppc+i386+x86_64. Might have to do with using the 10.4u SDK, but changing to 10.5 didn't help either. -- ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, missing required architecture x86_64 in file ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks//IOKit.framework/IOKit, missing required architecture x86_64 in file Undefined symbols for architecture x86_64: "___CFConstantStringClassReference", referenced from: __cfstring at 0 in SerialImp.o __cfstring at 0 in SerialImp.o "_CFStringCreateWithCString", referenced from: _getRegistryString in SerialImp.o "_CFDictionarySetValue", referenced from: _createSerialIterator in SerialImp.o "_IOServiceMatching", referenced from: _createSerialIterator in SerialImp.o "_IOMasterPort", referenced from: _createSerialIterator in SerialImp.o "_CFRelease", referenced from: _getRegistryString in SerialImp.o "_kCFAllocatorDefault", referenced from: _getRegistryString in SerialImp.o "_select$1050", referenced from: _read_byte_array in SerialImp.o _Java_gnu_io_RXTXPort_eventLoop in SerialImp.o "_IOIteratorNext", referenced from: _registerKnownSerialPorts in SerialImp.o "_CFStringGetCString", referenced from: _getRegistryString in SerialImp.o "_IORegistryEntryCreateCFProperty", referenced from: _getRegistryString in SerialImp.o "_IOServiceGetMatchingServices", referenced from: _createSerialIterator in SerialImp.o ld: symbol(s) not found for architecture x86_64 -- Marius Kintel wrote: > Hi, > > I just looked into this, and found a bug in rxtx causing the "Invalid > memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is a > corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Zach Shelby | Head of Research | +358 40 7796297 Sensinode Ltd. www.sensinode.com From kintel at sim.no Thu Jun 12 08:12:04 2008 From: kintel at sim.no (Marius Kintel) Date: Thu, 12 Jun 2008 16:12:04 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <485115D9.6010609@sensinode.com> References: <485115D9.6010609@sensinode.com> Message-ID: On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > I was unsuccessful in getting x86_64 working with the CVS source. > There are some problems with x86_64 and IOKit.framework when you try > to compile ppc+i386+x86_64. Might have to do with using the 10.4u > SDK, but changing to 10.5 didn't help either. > I didn't try the CVS head. I was hoping for my patch to make it into CVS before looking closer at this. I'll try to give it a spin the next time I'm working on this. ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Thu Jun 12 20:27:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 12 Jun 2008 20:27:13 -0600 (MDT) Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: On Thu, 12 Jun 2008, Marius Kintel wrote: > > On Jun 12, 2008, at 2:26 PM, Zach Shelby wrote: > >> I was unsuccessful in getting x86_64 working with the CVS source. >> There are some problems with x86_64 and IOKit.framework when you try >> to compile ppc+i386+x86_64. Might have to do with using the 10.4u >> SDK, but changing to 10.5 didn't help either. >> > I didn't try the CVS head. I was hoping for my patch to make it into > CVS before looking closer at this. > I'll try to give it a spin the next time I'm working on this. > I was waiting to see if it worked for everyone. :) I'll be looking at 64 bit mac in a few weeks but don't have one at home to try it on or very much experience with the build environment. -- Trent Jarvi tjarvi at qbang.org From kintel at sim.no Fri Jun 13 03:53:43 2008 From: kintel at sim.no (Marius Kintel) Date: Fri, 13 Jun 2008 11:53:43 +0200 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <485115D9.6010609@sensinode.com> Message-ID: <42B89B1D-1E99-427A-A350-6914D8B5364E@sim.no> On Jun 13, 2008, at 4:27 AM, Trent Jarvi wrote: > I was waiting to see if it worked for everyone. :) I'll be looking > at 64 bit mac in a few weeks but don't have one at home to try it on > or very much experience with the build environment. > Good. I'm not working on rxrx related stuff very often either, but this time around I coul